package de.melistik;

import java.io.File;

import javax.swing.ImageIcon;

public final class IconHandler {
	
	public final static ImageIcon accept = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/accept.png"));
	public final static ImageIcon computerKey = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/computer_key.png"));
	public final static ImageIcon cross = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/cross.png"));
	public final static ImageIcon delete = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/delete.png"));
	public final static ImageIcon disk = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/disk.png"));
	public final static ImageIcon driveNetwork = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/drive_network.png"));
	public final static ImageIcon driveUser = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/drive_user.png"));
	public final static ImageIcon driveWeb = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/drive_web.png"));
	public final static ImageIcon email = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/email.png"));
	public final static ImageIcon error = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/error.png"));
	public final static ImageIcon exclamation = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/exclamation.png"));
	public final static ImageIcon fatcow = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/fatcow.png"));
	public final static ImageIcon fileExtensionBmp = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/file_extension_bmp.png"));
	public final static ImageIcon fileExtensionJpg = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/file_extension_jpg.png"));
	public final static ImageIcon fileExtensionPng = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/file_extension_png.png"));
	public final static ImageIcon fileExtensionWmv = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/file_extension_wmv.png"));
	public final static ImageIcon fileManager = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/file_manager.png"));
	public final static ImageIcon folderPicture = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/folder_picture.png"));
	public final static ImageIcon keyEscape = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/key_escape.png"));
	public final static ImageIcon photos = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/photos.png"));
	public final static ImageIcon picture = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/picture.png"));
	public final static ImageIcon progressbar = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/progressbar.png"));
	public final static ImageIcon radiobuttonGroup = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/radiobutton_group.png"));
	public final static ImageIcon serverConnect = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/server_connect.png"));
	public final static ImageIcon smugmug = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/smugmug.png"));
	public final static ImageIcon tag = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/tag.png"));
	public final static ImageIcon tagBlueEdit = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/tag_blue_edit.png"));
	public final static ImageIcon tagRed = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/tag_red.png"));
	public final static ImageIcon update = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/update.png"));
	public final static ImageIcon vcardEdit = new ImageIcon(IconHandler.class.getResource("/de/melistik/icons/vcard_edit.png"));


	public static void main(String[] args) {
		IconHandler me = new IconHandler();
		File[] iconList = new File(IconHandler.class.getResource("icons")
				.getPath()).listFiles();
		for (int x = 0; x < iconList.length; x++) {
			System.out.println("public final static ImageIcon "
					+ me.convertToCamelCase(iconList[x].getName().replace(
							".png", "")) + " = new ImageIcon("
					+ "IconHandler.class.getResource(\"/de/melistik/icons/"
					+ iconList[x].getName() + "\"));");
		}
	}

	public String convertToCamelCase(String paramName) {
		StringBuffer sb = new StringBuffer();
		for (String s : paramName.split("_")) {
			if (sb.length() <= 0) {
				sb.append(Character.toLowerCase(s.charAt(0)));
			} else {
				sb.append(Character.toUpperCase(s.charAt(0)));
			}
			if (s.length() > 1) {
				sb.append(s.substring(1, s.length()).toLowerCase());
			}
		}
		return sb.toString();
	}

}
